<template>
	<div class="destination">
		<label>
			<h3>当季目的地</h3>
			<p>你的朋友圈的旅行内容，我们包了</p>
			<router-link to='/'>更多><i class="iconfont"></i></router-link>
		</label>
		<div class="de-ul">
			<ul>
				<li v-for="item in deArr" :key='item.id' @click="iscur = item.id" :class="{'bclass' : iscur == item.id}">
			<router-link to='/' :class="{'aclass' : iscur==item.id}"  >
				{{item.name}}
			</router-link>		
				</li>
			</ul>
		</div>
		<DestinationDay1 :propsDestinationDay1="de1Arr" v-if="iscur===1"></DestinationDay1>
		<DestinationDay2 :propsDestinationDay2="de2Arr" v-if="iscur===2"></DestinationDay2>
	</div>
</template>

<script>
	import DestinationDay1 from './DestinationDay1.vue'
	import DestinationDay2 from './DestinationDay2.vue'
	export default{
		name:'Destination',
		props:{
			propsDestination:{
				type:Object,
				default:function(){
					return{}
				}
			}
		},
		data(){
			return{
				deArr:[],
				de1Arr:[],
				de2Arr:[],
				iscur:1
			}
		},
		watch:{
			propsDestination(){
				this.deArr = this.propsDestination.Destination_arr
				this.de1Arr = this.propsDestination.Destination_arr[0]
				this.de2Arr = this.propsDestination.Destination_arr[1]
			}
		},
		components:{
			DestinationDay1,
			DestinationDay2
		}
	}
</script>

<style scoped>
	a{
		text-decoration: none;
	}
	.destination{
		margin-top: 1rem;
		width: 100%;
		overflow: hidden;
		margin-bottom: 1.5rem;
	}
	.destination label{
		width: 95%;
		margin: 0 auto;
		display: flex;
	}
	.destination label h3{
		font-size: 0.42rem;
		font-weight: bold;
		line-height: 0.5rem;
	}
	.destination label p{
		line-height: 0.5rem;
		margin-left: 10%;
		font-size: 0.32rem;
		padding: 0 0.15rem;
		border-radius: 0.14rem;
		background-color: #fff3ea;
		color: #ff9e51;
	}
	.destination label a{
		margin-left: auto;
		font-size: 0.35rem;
		color: black;
	}
	.destination .de-ul{
		width: 95%;
		overflow: hidden;
		
		/* background-color: #FF9E51; */
		margin:  0 auto;
	}
	.destination .de-ul ul{
		display: flex;
		margin-top: 0.3rem;
		margin-bottom: 0.2rem;
	}
	.destination .de-ul ul li{
		width: 2rem;
		margin-left: 0.01rem;
		font-size: 0.35rem;
		border-radius: 0.5rem;
		margin-right: 0.2rem;
		text-align: center;
		line-height: 0.7rem;
		border: 1px solid gainsboro;
	}
	.destination .de-ul ul li a{
		color: #666666;
	}
	.destination .de-ul ul .bclass{
		box-shadow: 0px 0px 0.5px 0px #666666;
	}
	.destination .de-ul ul li .aclass{
		color: #f0be00;
		font-weight: bold;
		
	}
</style>
